package com.iot.ic.modules.service.impl;

import com.iot.ic.modules.dao.BankDao;
import com.iot.ic.modules.model.UserBank;
import com.iot.ic.modules.service.BankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("bankService")
public class BankServiceImpl implements BankService {
    @Autowired
    private BankDao bankDao;

    @Override
    public UserBank addBank(UserBank bank) throws Exception {
        return (UserBank) bankDao.addOrUpdateObject(bank);
    }

    @Override
    public UserBank findBankByNo(String bankNo) throws Exception {
        return bankDao.findBankByNo(bankNo);
    }

    @Override
    public List<UserBank> findBank(Integer id, Integer userId, String bankNo) throws Exception {
        return bankDao.findBank( id,  userId,  bankNo);
    }
}
